//计算服务器消耗时常的中间件
module.exports = async (ctx, next) => {
  const start = Date.now()
  await next()
  const end = Date.now()
  //设置
  ctx.set('X-Response-Time', end - start + 'ms')
}